Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Add build script for win #3410

Merged
merged 10 commits into from
Nov 8, 2021

Conversation

frostming
Copy link
Collaborator

@frostming frostming commented Nov 6, 2021

Related issue = #3391 #2715

  1. Fix the cmake file to support in-venv build
  2. Add a build script for windows as requested in Create a bash script for windows dev install  #3391 that:
    a. Usage: win_build.ps1 [[-libdir] <string>] [-clone] [-installVulkan] [-develop] [-install]
    b. Support rerun, won't download again if already exists
    c. build and install python library in a virtual environment to avoid contaminating the system site-packages
    d. support install in develop mode(with -develop flag), like python setup.py develop
    e. CMake args and environments are populated automatically, users don't bother to set them.
  3. Replace the building steps in postsubmit and presubmit CI jobs with the script.

I've tested on Windows 10, CPU build, both build and install are successful. If you have a Windows PC, please help to test the script.

Other thoughts

Now setting up a taichi development environment on Windows is as easy as downloading a script from the internet and run it. We may also do the same for linux and mac. And development installation doc can be updated accordingly.

@netlify
Copy link

netlify bot commented Nov 6, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc ready!

🔨 Explore the source changes: 1fbd7d6

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/6188f1d07ec7490008cf8698

😎 Browse the preview: https://deploy-preview-3410--jovial-fermat-aa59dc.netlify.app

@frostming frostming changed the title [ci] add build script for win [ci] Add build script for win Nov 6, 2021
New-Item -ItemType Directory -Path $build
}
Push-Location $build
WriteInfo("Download and extract LLVM")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the LLVM/clang/Vulkan libs usually are usually downloaded once and placed somewhere outside the repo dir/build dir, (i.e., a more stable place, e.g. C:\ThirdParty\Libs). I'd suggest that we add one additional flag to hold all these required dependent libs, WDYT?

In addition, let's make the default behavior not to download these libs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the lib location can be specified with -build option, and if the library exists, won't download again.

So -build C:\ThirdParty\Libs can do the trick.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, then let's give it a more obvious name, e.g. libsdir, depsdir, ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name is changed to libdir

Copy link
Member

@k-ye k-ye Nov 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I guess the naming convention here is $libsDir? Also, the default value should be empty (or at least not _build)

Copy link
Collaborator Author

@frostming frostming Nov 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the name and default to the current location (.) since empty isn't a valid path parameter

.github/workflows/scripts/win_build.ps1 Outdated Show resolved Hide resolved
@k-ye
Copy link
Member

k-ye commented Nov 7, 2021

Now setting up a taichi development environment on Windows is as easy as downloading a script from the internet and run it. We may also do the same for linux and mac. And development installation doc can be updated accordingly.

This would be a great step forward! We used to think about using conda to automate/simplify the process. Any suggestions on this :-) ?

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! I've tried this on a windows machine here and it worked like a charm!
Nit: is it possible to forward the real-time logs to the terminal when building taichi? ;) currently it stays silent for a while and then dumps all the logs at once :P

cmake/PythonNumpyPybind11.cmake Outdated Show resolved Hide resolved
@ailzhang ailzhang merged commit 0349967 into taichi-dev:master Nov 8, 2021
@frostming frostming deleted the ci/win-build-script branch November 9, 2021 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants